package com.hyq.learn.web.config;

import com.hyq.learn.web.env.LearnEnvironment;
import com.hyq.learn.web.env.LearnEnvironmentSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

/**
 * @author heyuqin
 * @date 2024/5/27 16:41
 */
@Configuration
@ConditionalOnClass(value = {LearnEnvironment.class})
public class LearnWebAutoConfig {

    private final static Logger LOGGER = LoggerFactory.getLogger(LearnWebAutoConfig.class);


    @Bean
    public LearnEnvironment learnEnvironment(Environment environment) {
        LOGGER.info("learn environment init...");
        return new LearnEnvironmentSupport(environment);
    }

}
